package jjj;

import java.util.Arrays;
import java.util.Scanner;

public class Test21{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine()){
			String choice = sc.nextLine();
			switch (choice) {
			case "fib":
				fib(sc);
				break;
			case "search":
				search(sc);
				break;
			case "sort":
				sort(sc);
				break;
			case "getBirthDate":
				getBirthDate(sc);
				break;
			default:
				cuowu(sc);
				break;
			}
			sc.nextLine();
		}
		sc.close();
	}
	private static void cuowu(Scanner sc) {
	          System.out.println("exit");

	}

	private static void sort(Scanner sc) {
		int i;
		String s = sc.nextLine();
		String[] str1 = s.split(" ");
		int[] str2 = new int[str1.length];
		for(i=0;i<str1.length;i++) {
			str2[i] = Integer.parseInt(str1[i]);
		}
		Arrays.sort(str2);
		System.out.println(Arrays.toString(str2));
	}

	private static void search(Scanner sc) {
		System.out.println("exit");
	}

	private static void fib(Scanner sc) {
		 int n=sc.nextInt();
	     int a=1, b=0, c=0;
	     for(int i=0;i<n;i++) {
	    	 c = a + b;
	         a = b;
	         b = c;
	         System.out.print(c);
	         if(i!=(n-1))  System.out.print(" ");
	     }
	     System.out.println();
	}
	
	private static void getBirthDate(Scanner sc){
		String[] str = new String[100];
		String[] str1 = new String[100];
		int n,i;
    n = sc.nextInt();
    for(i=0;i<n;i++){
      str[i]=sc.next();
    }
		for(i=0;i<n;i++){
		  str1[i] = str[i].substring(6, 10) + "-" + str[i].substring(10, 12) + "-" + str[i].substring(12, 14);
		}
		for (int j = 0; j < n; j++) {
			String e = str1[j];
			System.out.println(e);
		}
   }
}